package edu.sctu.xuping.month05.day20150511;

/**
 * Created by user16 on 2015/5/11.
 */
public class TextTwo extends TextOne {
    private String name;
    private int age;
    private int income;

    public TextTwo(String name, int age, int income) {
        this.name = name;
        this.age = age;
        this.income = income;
    }


    @Override
    public void getAge() {
        if (age > 18) {
            System.out.println("年龄为" + age);
        } else {
            System.out.println(age + "是未成年");
        }
    }

    @Override
    public void getName() {
        if (name.equals("张三")) {
            System.out.println(name);
        } else {
            System.out.println("have no the person");
        }
    }

    @Override
    public void getIncome() {
        if (income > 2000) {
            System.out.println("the income is good");
        }
    }

    public void getInformation() {
        this.getAge();
        this.getName();
        this.getIncome();
    }
}
